# kubectl apply -f ./rancher/ingress-rancher.yaml

export namespace="cattle-system"
export app_name="rancher"
export repo="rancher-latest"
export helm="$repo/$app_name"
export url="http://rancher-mirror.oss-cn-beijing.aliyuncs.com/server-charts/latest"

# helm repo remove $repo
helm repo add $repo $url
helm repo update $repo

# export hostname="rancher.youling.io"
export hostname="rancher.e.lntu.edu.cn"
export bootstrapPassword="admin"
export systemDefaultRegistry="registry.cn-hangzhou.aliyuncs.com"
export rancherImage="${systemDefaultRegistry}/rancher/rancher"

# helm search repo rancher --devel --versions

helm upgrade --create-namespace --install \
    -n $namespace $app_name $helm \
    --set hostname="${hostname}" \
    --set replicas=3 \
    --set bootstrapPassword="${bootstrapPassword}" \
    --set rancherImage="${rancherImage}" \
    --set systemDefaultRegistry="${systemDefaultRegistry}" \
    --set ingress.tls.source=rancher \
    -f values.yaml
